package yang.yu.sunny.domain.sales;

import yang.yu.sunny.domain.NamedEntity;

import java.util.Objects;

/**
 * 客户
 * Created by yyang on 16/3/15.
 */
public class Customer extends NamedEntity {

    private String province;

    private String address;

    protected Customer() {
    }

    public Customer(String name) {
        super(name);
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }
        if (!(other instanceof Customer)) {
            return false;
        }
        Customer that = (Customer) other;
        return Objects.equals(getName(), that.getName());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getName());
    }

    @Override
    public String toString() {
        return "Customer{" +
                "name='" + getName() + '\'' +
                '}';
    }
}
